{block name=member_form_fields}
{* Define the function *} {function name=options_list level=0} 
	{foreach $opts as $opt}
		{if $level eq 0}
			<optgroup label="{$opt.value}">
		{else}
			<option value="{$opt.id}" {if $selected eq $opt.id}selected="selected"{/if}>{$opt.value}</option>
		{/if}
		{if count($opt.subs) > 0} {call name=options_list opts=$opt.subs level=$level+1 } {/if} 
	{/foreach} 
{/function}

    <input type="hidden" value="{$user.user_id}" name="user[user_id]" id="user_id" />
    <div class="form-group">
        <label for="email" class="col-sm-3 control-label">邮箱*</label>
        <div class="col-sm-9">
            <input type="email" value="{$user.user_email}" class="form-control" id="reg-email" name="user[user_email]" required>
        <span class="help-block"></span>
      </div>
    </div>
    <div class="form-group">
        <label for="gname" class="col-sm-3 control-label">姓名*</label>
        <div class="col-sm-9">
            <input type="text" value="{$user.user_gname}" class="form-control" id="gname" name="user[user_gname]" required>
        <span class="help-block"></span>
      </div>
    </div>
		<div class="form-group">
      <label class="col-sm-3 control-label" for="suburb">电话</label>
      <div class="col-sm-9">
        <input id="phone" value="{if $address}{$address.B.address_telephone}{/if}" name="address[B][address_telephone]" type="text" class="phone billing-req form-control" />
      </div>
    </div>
		<div class="form-group">
      <label class="col-sm-3 control-label" for="street">地址</label>
      <div class="col-sm-9">
        <input id="street" value="{if $address}{$address.B.address_line1}{/if}" name="address[B][address_line1]" type="text" class="billing-req form-control"/>
      </div>
    </div>
    <!-- <div class="form-group">
      <label class="col-sm-3 control-label" for="suburb">地区</label>
      <div class="col-sm-9">
        <input id="suburb" value="{if $address}{$address.B.address_suburb}{else}{$selectedShippingSuburb}{/if}" name="address[B][address_suburb]" type="text" class="billing-req form-control"/>
      </div>
    </div> -->
    <div class="form-group">
      <label class="col-sm-3 control-label" for="suburb">省/市*</label>
      <div class="col-sm-3">
        <select id="state" name="address[B][address_state]" class="required form-control">
          <!-- <option value="">请选择</option> -->
					<option value="北京市" {if $address.B.address_state eq '北京市'}selected="selected"{/if} >北京市</option>
					<option value="天津市" {if $address.B.address_state eq '天津市'}selected="selected"{/if}>天津市</option>
        </select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="suburb">邮编</label>
      <div class="col-sm-2">
        <input id="postcode-field" value="{if $address}{$address.B.address_postcode}{/if}" name="address[B][address_postcode]" pattern="[0-9]" type="text" class="postcode billing-req form-control"/>
      </div>
    </div>
    
    <div class="form-group">
			<label class="col-sm-3 control-label" for="hearabout">从何处了解我们?</label>
			<div class="col-sm-5">
				<select id="hearabout" required="" class="form-control required" name="user[user_hearabout]">
					<!-- <option value="">请选择</option> -->
						{call name=options_list opts=$hearabout selected=$user.user_hearabout}
				</select>
			</div>
		</div>
					
    {if $newMember}
    <div class="form-group">
        <label class="col-sm-3 control-label">警告</label>
        <div class="col-sm-9">
        	<textarea class="form-control" name="user[user_warning]">{$user.user_warning}</textarea>
      	</div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">注意</label>
        <div class="col-sm-9">
        	<textarea class="form-control" name="user[notes][note_content]">{$user.notes.note_content}</textarea>
      	</div>
    </div>
		{/if}        

    <div class="col-sm-offset-3 error-alert" style="display:none;">
    	<div class="alert alert-danger fade in ">
				<button class="close" aria-hidden="true" type="button" onclick="$(this).closest('.error-alert').fadeOut('slow');">&times;</button>
				<strong></strong>
			</div>
    </div>
{/block}




                    
            
